package com.xls.box2023.customcontrol;

/**
 * @author lhx
 * @description:
 * @date : 2024/2/2 10:43
 */

import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.widget.ImageView;

import com.xls.box2023.R;


public class LoginDialog extends Dialog {
    private ImageView img_show;
    private AnimationDrawable anim;

    public LoginDialog(Context context) {
        super(context, R.style.Splash);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setContentView(R.layout.dialog_login);
        initView();
    }

    private void initView() {
        img_show = findViewById(R.id.img_show);
        anim = (AnimationDrawable) img_show.getBackground();
    }

    @Override
    public void show() {
        super.show();
        anim.start();
    }

    @Override
    public void dismiss() {
        anim.stop();
        super.dismiss();
    }
}

